<!-- 意向企业详情 -->
<template>
  <div class="layout">
    <ContainerTitle text="企业基本信息" class="title"></ContainerTitle>
    <div class="content">
      <div class="row">
        <span>企业名称：</span>
        <span>{{ detail.companyName ? detail.companyName : '-' }}</span>
      </div>
      <div class="row">
        <span>信用代码：</span>
        <span>{{ detail.companyCode ? detail.companyCode : '-' }}</span>
      </div>
      <div class="row">
        <span>企业类型：</span>
        <span>{{ detail.companyType ? detail.companyType : '-' }}</span>
      </div>
    </div>
    <ContainerTitle text="意向楼宇" class="title"></ContainerTitle>
    <div class="content">
      <div class="row">
        <span>楼宇名称：</span>
        <span>{{ detail.buildingName }}</span>
      </div>
      <div class="row">
        <span>详细地址：</span>
        <span>{{ detail.address ? detail.address : '-' }}</span>
      </div>
      <div class="row">
        <span>楼宇级别：</span>
        <span v-if="Leave && detail.buildingLeave && $selectDict(Leave, detail.buildingLeave)">
          {{ $selectDict(Leave, detail.buildingLeave).dictLabel }}
        </span>
      </div>
      <div class="row">
        <span>联系人：</span>
        <span>{{ detail.contactsPerson ? detail.contactsPerson : "-" }}</span>
      </div>
      <div class="row">
        <span>联系电话：</span>
        <span>{{ detail.contactsPhone ? detail.contactsPhone : "-" }}</span>
      </div>
    </div>
    <Buttons :buttons="buttons" @getRevert="getRevert" class="btn"></Buttons>
  </div>
</template>

<script>
import { getIntendedCompanyDetails } from '@/common/api/company.js'
export default {
  data() {
    //这里存放数据
    return {
      buttons:[{ text: "返回", type: "normal", size: "l", method: "getRevert" }],
      crumbs: [
        {
          label: "企业空间",
          value: "company",
        },
        {
          label: "招商中心",
          value: "investment",
        },
        {
          label: "我的楼宇",
          value: "myBuilding",
        },
        {
          label: "意向企业",
          value: "buildingDetail",
          parameter: {}
        },
        {
          label: "意向企业详情",
          value: "",
          choose: true,
        },
      ],
      Leave: {},
      id: "",
      detail: {},
      companyId: '',
      buildingName: ''
    };
  },
  //方法集合
  methods: {
    async getMessage() {
      let res = await getIntendedCompanyDetails({ buildingIntendedUserId: this.id })
      if (res.code == 200) {
        // console.log('1234',res);
        this.detail = res.data;
      }
    },
    // 获取字典
    async getDict() {
      // 调用公共方法中的查询字典表
      this.getDictList(this,`building_leave`).then(res => {
        this.Leave = res.building_leave;
      })
    },
    getRevert() {
      this.$router.go(-1)
    }
  },
  mounted() {
    this.id = this.$route.query.id;
    this.buildingName = this.$route.query.buildingName
    this.companyId = this.$route.query.companyId
    this.crumbs[3].parameter = {
      id: this.companyId,
      name: this.buildingName,
      type: 2
    }
    this.getMessage()
    this.getDict()
  }
};
</script>
<style lang='scss' scoped>
//@import url(); 引入公共css类
.breadcrumb {
  width: 1000px;
  margin: 20px 0;
}

.roomDiv {
  display: flex;
  justify-content: center;
}

.roomDiv .leftDiv {
  width: 200px;
  text-align: left;
}

.roomDiv .rightDiv {
  width: 800px;
  margin-left: 30px;
  text-align: left;
}

.titleDiv {
  border-bottom: 2px solid #045db9;
  text-align: left;
  padding: 10px;
  padding-top: 0;
  font-size: 20px;
  font-weight: bold;
  color: #045db9;
  margin-bottom: 20px;
}

.content {
  padding: 11px 0 42px;
}
.row {
  font-size: 14px;
  color: #666666;
  margin-top: 15px;
  text-align:left;
}

.msgDiv {
  margin: 40px 0;
}

.toLoginBtn {
  color: #ffffff;
  background-color: #045db9;
  padding: 10px 40px;
  display: inline-block;
  font-size: 15px;
  border-radius: 5px;
  transition: all 0.2s ease 0s;
}

.toLoginBtn:hover {
  cursor: pointer;
  box-shadow: 0px 0px 5px #eeeeee;
}

.layout {
  min-height: 100vh;
  position: relative;
  padding-bottom: 150px;
  box-sizing: border-box;
}

.footer {
  position: absolute;
  bottom: 0;
  width: 100%;
}

.btn {
  width: 120px;
  height: 40px;
  line-height: 40px;
  text-align: center;
  color: #045db9;
  margin: 34px auto 0;
  font-size: 14px;
  background: #f1f2f4;
  border-radius: 3px;
  cursor: pointer;
}
</style>